Developer Documentation

QuickTime 4 API Documentation

QuickTime 4 Reference

| Previous | Chapter Contents | Chapter Top | Next |

Flags for Transfer Modes

QuickDraw GX provides two sets of flags in the transfer mode structure that control certain aspects of the transfer mode operation. One set operates on individual color components; the other set operates on the source or destination color as a whole, taking into account all of the components.

Transfer Component Flags

The transfer component flags are a set of flags in the gxTransferComponent structure (in the component field of the transfer mode structure) that alter the source, destination, or result value for an individual color component. There are two constants for these flags, defined in the gxComponentFlags enumeration:

Constant

Value

Explanation

gxOverResultComponent

0x01

QuickDraw GX performs an AND operation between the result color and 0xFFFF before clamping.

gxReverseComponent

0x02

QuickDraw GX reverses the source and destination values before performing the transfer mode operation.

Specifying gxOverResultComponent allows the result of transfers using gxAddMode to wrap around (from 0xFFFF to 0x0000 ) instead of remaining clamped at 0xFFFF .

Specifying gxReverseComponent allows you to apply a transfer mode backwards--from the destination to the source--for a particular component. It is most useful for component modes that depend on order, like gxMigrateMode , or gxAddMode when used for subtraction.

Transfer Mode Flags

The transfer mode flags are a set of flags in the flags field of the transfer mode structure. They affect how color limits are used and whether a single component mode is to be used for all color components. There are three values for the flags, defined in the gxTransferFlags enumeration:

Constant

Value

Explanation

gxRejectSourceTransfer

0x0001

Negate the results of sourceMinimum and sourceMaximum for all components. Accept only values outside of the specified ranges.

gxRejectDeviceTransfer

0x0002

Negate the results of deviceMinimum and deviceMaximum for all components. Accept only values outside of the specified ranges.

gxSingleComponentTransfer

0x0004

Use a single transfer component for
all color components. Duplicate component[0] in the transfer mode structure for all components in the transfer mode's color space.

Setting the gxRejectSourceTransfer or gxRejectDeviceTransfer flag causes an inversion of the acceptable color ranges for source or destination color, respectively. For example, in Figure 51 , setting the gxRejectSourceTransfer or gxRejectDeviceTransfer flag would cause the white (empty) portions of the large cubes that represent RGB space to be within range, instead of the gray (filled) portions.

The effect is similar to, although not exactly the same as, individually reversing the minimum and maximum values for the color components. If the transfer mode flag is cleared, drawing occurs only when all components are inside the allowed ranges--that is, inside the darker gray portions of the large cubes in Figure 51 . With the flag set, drawing occurs any time at least one component is outside of its allowed range--that is, with values anywhere outside of the dark gray areas in Figure 51 .

The gxSingleComponentTransfer flag is provided as a convenience. You can set the flag when you don't need the flexibility (and extra effort) of specifying different transfer modes for different color components. In this case you need set up only one gxTransferComponent structure, instead of one for each component in the transfer mode's color space.   


© 1999 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |